// Name：P3_1.c
// Purpose：简单计算分式的值
// Author：wjy
// From：《C语言程序设计：现代方法》（第二版）第三章第6题
// Date：2021.12.30

#include <stdio.h> 
#include <stdlib.h>

int main(void)
{
    int num1, num2, num3, num4;
    printf ("Enter two fractions separated by a plus sign: ");
    scanf ("%d/%d+%d/%d", &num1, &num2, &num3, &num4);
    printf ("The sum is %d/%d\n", (num1 * num4 + num3 * num2), num2 * num4);
    system ("pause");
    return 0;
}